import { Tooltip } from "antd"
import useAppStore from "@renderer/store/useAppStore"
import $ipc from "@renderer/services/ipc/ipc.service"

export default function AppHeader() {
  function toggleSetting() {
    useAppStore.setState({showSetting: !useAppStore.getState().showSetting})
  }
  function openSaveDir() {
    $ipc.openSaveDir().subscribe()
  }
  function exitApp() {
    $ipc.exitApp().subscribe()
  }
  return (
    <div className="flex flex-row justify-center items-center h-10 can-drag relative text-white font-bold">
      <div onClick={exitApp} className="cursor-pointer w-10 h-10 flex items-center justify-center absolute top-0 left-0 can-not-drag">
        <i className="iconfont icon-mac_close text-[20px]"></i>
      </div>
      Tiny PNG
      <div className="cursor-pointer h-10 flex items-center justify-center absolute top-0 right-0 can-not-drag">
        <i onClick={openSaveDir} className="iconfont icon-folder cursor-pointer"></i>
        <i onClick={toggleSetting} className="iconfont icon-setting mx-3"></i>
      </div>
      
    </div>
  )
}